/*
 *--------------------------------------------------------------------------
 *   Battlefield - A Realtime Network Multiplayer Game
 *   =====================================================
 *   Developed by Group D02 - 2009/2010 Semester 4 - CS2103
 *     Harry Nguyen Duy Hoang <nnduyhoang@yahoo.co.uk>
 *     Kent Chng Siang Rong <fivefootway@gmail.com>
 *     Lim Yong Peng <limpeng1986@gmail.com>
 *     Loh Xiankun <u0807185@nus.edu.sg>
 *   Instructed by
 *     Dr. Damith C.Rajapakse <damith@gmail.com>
 *   =====================================================
 *   $Id: MapCell.java 565 2010-07-25 20:55:17Z Harry $
 *   $LastChangedDate: 2010-07-25 20:55:17 +0000 (Sun, 25 Jul 2010) $
 *   $LastChangedBy: Harry $
 *--------------------------------------------------------------------------
 */
package battlefield.entity;

/**
 *
 * @author Harry Nguyen
 */
public class MapCell extends Cell {

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }

        if (!(obj instanceof MapCell)) {
            return false;
        }

        MapCell c = (MapCell) obj;

        if (this.getBackgroundImage() == null || !this.getBackgroundImage().equals(c.getBackgroundImage())) {
            return false;
        }

        if (this.getDestroyedImage() == null || !this.getDestroyedImage().equals(c.getDestroyedImage())) {
            return false;
        }

        return this.getState() == c.getState();
    }
}
